﻿using FDEEPublicFunc;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FDEEMain
{
    public partial class BufferDepthForm : Form
    {
        public string filePlinthName = "";
        public string fileBeamParaName = "";
        public FDEE.Model.eSubType eHeightType = FDEE.Model.eSubType.None;
        public string piersString = "";
        public string IAParas = "";
        public string IBParas = "";
        public string TAParas = "";
        public string TBParas = "";
        public string title = "";
        public BufferDepthForm(bool isT=true)
        {
            InitializeComponent();
            if(isT)
            {
                Tpan.Visible = true;
                Ipan.Visible = false;
            }
            else
            {
                Tpan.Visible = false;
                Ipan.Visible = true;
            }
        }
      

        private void btnConfim_Click(object sender, EventArgs e)
        {
            title = cbLine.Text;

            if (string.IsNullOrWhiteSpace(filePlinthName))
            {
                MessageBox.Show("请选择垫石坐标表！", "提示");
                return;
            }
            if (string.IsNullOrWhiteSpace(fileBeamParaName))
            {
                //MessageBox.Show("请选择盖梁垫石参数表！", "提示");
                //return;
            }
            piersString = pierList.Text;
             IAParas = IPara.Text;
            IBParas = iBPara.Text;
            TAParas = TPara.Text;
            TBParas = TBPara.Text;
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnSelect_Click(object sender, EventArgs e)
        {
            //打开文件
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.DefaultExt = "xlsx";
            dlg.Filter = "xlsx Files|*.xlsx";
            if (dlg.ShowDialog() == DialogResult.OK)
                fileBeamParaName = dlg.FileName;
            if (fileBeamParaName == null)
                return;
            tkPath.Text = fileBeamParaName;// new System.IO.FileInfo(fileName).Name;

        }

        private void btnPlinth_Click(object sender, EventArgs e)
        {
            //打开文件
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.DefaultExt = "csv";
            dlg.Filter = "csv Files|*.csv";
            if (dlg.ShowDialog() == DialogResult.OK)
                filePlinthName = dlg.FileName;
            if (filePlinthName == null)
                return;
            plinthPath.Text = filePlinthName;// new System.IO.FileInfo(fileName).Name;
        }
    }
}
